/**
 * Created by fang.ming on 2017/5/4.
 */
import Vue from 'vue'
import VueResource from 'vue-resource';
Vue.use(VueResource);

export default {
  /**
   * 查询所有房间类型图标样例
   */
  getRoomTypeExamples() {
    return Vue.http.get("/roomManage/m/getRoomTypeExamples");
  },

  /**
   * 查询建筑结构树
   */
  getStructure() {
    return Vue.http.get("/roomManage/m/getStructure");
  },

  /**
   * 根据楼层id查询房间结构树
   */
  getRoomTreeByFlId(flId) {
    return Vue.http.get("/roomManage/m/getRoomTreeByFlId/" + flId);
  },

  /**
   * 保存建筑结构树并返回最新的树
   * @return latestTree
   */
  saveStructure(tree) {
    return Vue.http.post("/roomManage/m/saveStructure", tree);
  },

  /**
   * 删除建筑
   */
  removeBuilding(blId) {
    return Vue.http.post("/roomManage/m/removeBuilding", blId);
  },

  /**
   * 删除楼层
   */
  removeFloor(flId) {
    return Vue.http.post("/roomManage/m/removeFloor", flId);
  },

  /**
   * 查询当前楼层所有房间
   */
  getRoomGeo(flId) {
    return Vue.http.get("/roomManage/m/getRoomGeo/" + flId);
  },

  /**
   * 保存房间布局并返回最新布局
   * @return latestRooms
   */
  saveRoomGeo(flId, rooms) {
    return Vue.http.post("/roomManage/m/saveRoomGeo/" + flId, rooms);
  },

  /**
   * 删除房间
   */
  removeRoom(rmId) {
    return Vue.http.post("/roomManage/m/removeRoom", rmId);
  },

  /**
   * 查询所有房间类型
   */
  getRoomTypes() {
    return Vue.http.get("/roomManage/m/getRoomTypes");
  },

  /**
   * 新增或编辑房间类型
   */
  addOrUpdateRoomType(roomType) {
    return Vue.http.post("/roomManage/m/addOrUpdateRoomType", roomType);
  },

  /**
   * 删除房间类型
   */
  removeRoomType(rmTypeId) {
    return Vue.http.post("/roomManage/m/removeRoomType/" + rmTypeId);
  },

  /**
   * 查询房间标准列表
   */
  getRoomStandardList() {
    return Vue.http.get("/roomManage/m/getRoomStandardList");
  },

  /**
   * 根据房间号查询对应房间类型的房间标准列表
   */
  getRoomStandardListByRmId(rmId) {
    return Vue.http.get("/roomManage/m/getRoomStandardListByRmId/" + rmId);
  },

  /**
   * 查询房间标准详情
   */
  getRoomStandard(rmStdId) {
    return Vue.http.get("/roomManage/m/getRoomStandard/" + rmStdId);
  },

  /**
   * 新增或编辑房间标准详情
   */
  addOrUpdateRoomStandard(data) {
    return Vue.http.post("/roomManage/m/addOrUpdateRoomStandard", data);
  },

  /**
   * 删除房间标准
   */
  removeRoomStandard(rmStdId) {
    return Vue.http.post("/roomManage/m/removeRoomStandard", rmStdId);
  },

  /**
   * 获取房间信息
   */
  getRoomInfo(rmId) {
    return Vue.http.get("/roomManage/m/getRoomInfo/" + rmId);
  },

  /**
   * 编辑房间信息
   */
  updateRoomInfo(data) {
    return Vue.http.post("/roomManage/m/updateRoomInfo", data);
  },

  /**
   * 根据bedId删除床位
   */
  removeBed(bedId) {
    return Vue.http.post("/roomManage/m/removeBed", bedId);
  },

  /**
   * 获取床位预约界面结构树
   */
  getReserveStructure() {
    return Vue.http.get("/roomManage/m/getReserveStructure");
  },

  /**
   * 查询当前楼层所有房间床位
   */
  getReserveRoomBed(flId) {
    return Vue.http.get("/roomManage/m/getReserveRoomBed/" + flId);
  },

  /**
   * 根据床位ID获取床位使用信息
   */
  getMemberBedInfo(bedId) {
    return Vue.http.get("/roomManage/m/getMemberBedInfo/" + bedId);
  }
}
